package com.inspire.myapp;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import com.codename1.io.Externalizable;

public class categorie implements Externalizable {

	public String id=null;
	public String nom =null;
	public String iconMin=null;
	public String textMin=null;
	public String iconMax=null;
	public String textMax=null;
	public String iconMidle=null;
	public String textMidle=null;
	public String uuid=null;
	
	
	public categorie() {
		// TODO Auto-generated constructor stub
	}


	@Override
	public int getVersion() {
		return 0;
	}


	@Override
	public void externalize(DataOutputStream out) throws IOException {
		
		out.writeUTF(this.id);
		
		out.writeUTF(this.nom);
		
		out.writeUTF(this.iconMin);
		
		out.writeUTF(this.iconMax);
		
		out.writeUTF(this.iconMidle);
		
		out.writeUTF(this.textMin);
		
		out.writeUTF(this.textMax);
		
		out.writeUTF(this.textMidle);
		
		out.writeUTF(this.uuid);
		
		
		
		
	}


	@Override
	public void internalize(int version, DataInputStream in) throws IOException {
		switch (version) {
		case 0:
			this.id=in.readUTF();
			this.nom=in.readUTF();
			this.iconMin=in.readUTF();
			this.iconMax=in.readUTF();
			this.iconMidle=in.readUTF();
			this.textMin=in.readUTF();
			this.textMax=in.readUTF();
			this.textMidle=in.readUTF();
			this.uuid=in.readUTF();
			
			break;
		default:
			break;
		}
		
	}

	@Override
	public String getObjectId() {
		return "categorie_"+this.uuid;
	}

}
